package com.systop.payment.controller;

import java.util.Arrays;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.systop.payment.entity.OrderSubjoinEntity;
import com.systop.payment.service.OrderSubjoinService;
import com.systop.common.utils.PageUtils;
import com.systop.common.utils.R;



/**
 * 
 *
 * @author jsj
 * @email jsj@gmail.com
 * @date 2022-05-05 11:46:06
 */
@RestController
@RequestMapping("payment/ordersubjoin")
public class OrderSubjoinController {
    @Autowired
    private OrderSubjoinService orderSubjoinService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("payment:ordersubjoin:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = orderSubjoinService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("payment:ordersubjoin:info")
    public R info(@PathVariable("id") Integer id){
		OrderSubjoinEntity orderSubjoin = orderSubjoinService.getById(id);

        return R.ok().put("orderSubjoin", orderSubjoin);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("payment:ordersubjoin:save")
    public R save(@RequestBody OrderSubjoinEntity orderSubjoin){
		orderSubjoinService.save(orderSubjoin);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("payment:ordersubjoin:update")
    public R update(@RequestBody OrderSubjoinEntity orderSubjoin){
		orderSubjoinService.updateById(orderSubjoin);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("payment:ordersubjoin:delete")
    public R delete(@RequestBody Integer[] ids){
		orderSubjoinService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
